/*
 * Copyright 2020-2021 redragon.dongbin
 *
 * This file is part of redragon-erp/赤龙ERP.

 * redragon-erp/赤龙ERP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.

 * redragon-erp/赤龙ERP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with redragon-erp/赤龙ERP.  If not, see <https://www.gnu.org/licenses/>.
 */
package com.erp.cux.workflow.dao.model;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name="cux_workflow_record", schema="erp")
@DynamicInsert(true)
@DynamicUpdate(true)
public class CuxWorkflowRecord implements java.io.Serializable {

    //serialVersionUID
    private static final long serialVersionUID = 1L;

    //Constructors
    public CuxWorkflowRecord() {
    }
    
    //Fields
    
    //主键
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "record_id", unique = true, nullable = false)
    private Integer recordId;
    
    public Integer getRecordId() {
        return this.recordId;
    }
    public void setRecordId(Integer recordId) {
        this.recordId = recordId;
    }
    
    //记录编码
    @Column(name = "record_code", unique = true, nullable = false, length = 45)
    private String recordCode;
    
    public String getRecordCode() {
        return this.recordCode;
    }
    public void setRecordCode(String recordCode) {
        this.recordCode = recordCode;
    }
    
    //单据类型
    @NotBlank(message="单据类型不能为空")
    @Column(name = "bill_type", unique = false, nullable = false, length = 45)
    private String billType;
    
    public String getBillType() {
        return this.billType;
    }
    public void setBillType(String billType) {
        this.billType = billType;
    }
    
    //单据头编码
    @NotBlank(message="单据头编码不能为空")
    @Column(name = "bill_head_code", unique = false, nullable = false, length = 45)
    private String billHeadCode;
    
    public String getBillHeadCode() {
        return this.billHeadCode;
    }
    public void setBillHeadCode(String billHeadCode) {
        this.billHeadCode = billHeadCode;
    }
    
    //工作流配置头编码
    @NotBlank(message="工作流配置头编码不能为空")
    @Column(name = "conf_head_code", unique = false, nullable = false, length = 45)
    private String confHeadCode;
    
    public String getConfHeadCode() {
        return this.confHeadCode;
    }
    public void setConfHeadCode(String confHeadCode) {
        this.confHeadCode = confHeadCode;
    }
    
    //工作流配置行编码
    @NotBlank(message="工作流配置行编码不能为空")
    @Column(name = "conf_line_code", unique = false, nullable = false, length = 45)
    private String confLineCode;
    
    public String getConfLineCode() {
        return this.confLineCode;
    }
    public void setConfLineCode(String confLineCode) {
        this.confLineCode = confLineCode;
    }
    
    //审批人
    @NotBlank(message="审批人不能为空")
    @Column(name = "approve_person", unique = false, nullable = false, length = 45)
    private String approvePerson;
    
    public String getApprovePerson() {
        return this.approvePerson;
    }
    public void setApprovePerson(String approvePerson) {
        this.approvePerson = approvePerson;
    }
    
    //审批结果（PASS通过、NOPASS不通过）
    @Column(name = "approve_result", unique = false, nullable = false, length = 10)
    private String approveResult;
    
    public String getApproveResult() {
        return this.approveResult;
    }
    public void setApproveResult(String approveResult) {
        this.approveResult = approveResult;
    }
    
    //审批意见
    @Column(name = "approve_comment", unique = false, nullable = false, length = 200)
    private String approveComment;
    
    public String getApproveComment() {
        return this.approveComment;
    }
    public void setApproveComment(String approveComment) {
        this.approveComment = approveComment;
    }
    
    //创建时间
    @Column(name = "created_date", unique = false, nullable = false)
    private Date createdDate;
    
    public Date getCreatedDate() {
        return this.createdDate;
    }
    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }
    
    //创建人
    @Column(name = "created_by", unique = false, nullable = false, length = 45)
    private String createdBy;
    
    public String getCreatedBy() {
        return this.createdBy;
    }
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }
    
    //最后修改时间
    @Column(name = "last_updated_date", unique = false, nullable = true)
    private Date lastUpdatedDate;
    
    public Date getLastUpdatedDate() {
        return this.lastUpdatedDate;
    }
    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }
    
    //最后修改人
    @Column(name = "last_updated_by", unique = false, nullable = true, length = 45)
    private String lastUpdatedBy;
    
    public String getLastUpdatedBy() {
        return this.lastUpdatedBy;
    }
    public void setLastUpdatedBy(String lastUpdatedBy) {
        this.lastUpdatedBy = lastUpdatedBy;
    }
    
    //组织机构
    @Column(name = "org_code", unique = false, nullable = false, length = 45)
    private String orgCode;
    
    public String getOrgCode() {
        return this.orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    
    
    /*
         * 显示的字段
     */
    @Transient
    private String taskName;
    @Transient
    private String approvePersonName;
    @Transient
    private String approvePersonDepartment;
    @Transient
    private String approvePersonPosition;

    public String getTaskName() {
        return taskName;
    }
    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }
    public String getApprovePersonName() {
        return approvePersonName;
    }
    public void setApprovePersonName(String approvePersonName) {
        this.approvePersonName = approvePersonName;
    }
    public String getApprovePersonDepartment() {
        return approvePersonDepartment;
    }
    public void setApprovePersonDepartment(String approvePersonDepartment) {
        this.approvePersonDepartment = approvePersonDepartment;
    }
    public String getApprovePersonPosition() {
        return approvePersonPosition;
    }
    public void setApprovePersonPosition(String approvePersonPosition) {
        this.approvePersonPosition = approvePersonPosition;
    }
    
}